<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>上传图片</title>
    <style type="text/css"><!--
    #newPreview
    {
        filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);
    }
    --></style>
    <script type="text/javascript" language="javascript"><!--

    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]); return null;
    }
    // --></script>
</head>
<body>
<div id="man_zone">
    <form id="uploadForm" method="post" name="Upload"  enctype="multipart/form-data" target="_self">
        <table width="100%" border="0" align="center" cellpadding="3"
               cellspacing="1" class="table_style">
            <tr>
                <td class="left_title_2">
                    选择图片：
                </td>
                <td><input id="fileinput" type="file" name="file"><font color=red>*</font>
            </tr>
            <tr>
                <td class="left_title_1">
                    <input id="button" type="submit" name="Submit" value="上传" onclick=" return checkFile();" />
                </td>
            </tr>
        </table>
    </form>
</div>
<script type="text/javascript">
    var param = getQueryString("id");
    var form = document.getElementById("uploadForm");
    form.action = "/attachment?id="+param;

    function checkFile(){
        if (document.getElementById("fileinput").value=='undefined' || document.getElementById("fileinput").value =="")
        {
            alert("请先选择文件！");
            return false;
        }
        else return true;
    }
</script>
</body>
</html>